<template>
  <div>
    <el-dialog
      :title="option.title"
      :visible.sync="isShow"
      @close="closeUser"
      width="950px"
      @open="openCreate"
      :close-on-click-modal="false"
      center
    >
      <div v-loading="loading">
        <div class="content">
          <el-card style="margin-top:10px;">
      <el-table
        :data="tableData"
        ref="tableData"
        border
        class="tableMarginTop"
        header-row-class-name="tableHeaderClass"
        highlight-current-row
        style="min-height:390px;">
        <el-table-column prop="object" label="对象"></el-table-column>
        <el-table-column prop="YY_CurrentNUM_CallWait" label="当期排队数"></el-table-column>
        <el-table-column prop="YY_NUM_CallMissed" label="呼损量"></el-table-column>
        <el-table-column prop="YY_NUM_Calls" label="人工请求量"></el-table-column>
        <el-table-column prop="YY_NUM_CallAnswer" label="人工接通量" ></el-table-column>
        <el-table-column prop="YY_NUM_CallAnswer_per" label="人工接通率"></el-table-column>
        <el-table-column prop="YY_NUM_CallsAnswerIn20s_per" label="20S服务水平" ></el-table-column>
      </el-table>
    </el-card>
          <div style="text-align:center;margin-top:20px">
            <el-button size="mini" @click="addType" >关闭</el-button>
          </div>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import query from "@/message/siteManagement/queueDetail/query";
import request1 from "@/common/utils/requestYg";
import getGlobalParams from "@/common/utils/getGlobalParams";
import toolBox from "@/common/utils/toolBox";

export default {
  data() {
    return {
      radio: "",
      loading: false,
      tableData:[],
      form: {

      },
        
      rules: {
      }
    };
  },
  props: {
    //父元素传递的数据
    option: Object
  },
  computed: {
    isShow: {
      //创建用户弹窗是否显示
      get: function() {
        return this.option.isShow;
      },
      set: function(newValue) {
        this.option.isShow = newValue;
      }
    }
  },
  created: function() {
    
  },
  methods: {
    query(){
      this.loading = true;
      let resBody = new query();
      // resBody.data.PAGEFLAG = 4;
      // resBody.data.CURRPAGE = this.currentPage;
      // resBody.data.PAGEROWNUM = this.pageSize;

      request1(resBody)
      .then(response => {
        if(response.SYS_HEAD.ReturnCode === "000000"){
          this.tableData = response.RSP_BODY.QueueList || [];
          this.totalRcrdNum = response.RSP_BODY.RecordNum;
        } else {
          this.$message({
            type: "error",
            message: response.SYS_HEAD.ReturnMessage
          });
          this.tableData = [];
          this.totalRcrdNum = 0;
        }
        this.loading = false;
      })
      .catch(error => {
        this.loading = false;
      })
    },
    closeUser() {
      //关闭弹窗清楚表单数据并清楚表单验证
      // if (this.$refs["form"] != undefined) {
      //   this.$refs["form"].resetFields(); //清楚表单验证
      //   this.$refs["form"].clearValidate(); //清楚表单验证
      // }
      // this.$emit("refreshTable");
      this.detailon = true;
      this.showCommon = false;
    },
    addType() {
      //关闭弹窗事件，清楚表单验证
      this.option.isShow = false;
      // this.$refs.form.clearValidate();
    },
    openCreate(){
      this.query();
    }
  }
};
</script>
<style lang="scss" scoped>


